rm(list=ls())
library(rmarkdown)
library(dplyr)
library(logr)
setwd("/Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads")
log_open("4_Log/02_MatchingTable.log")
rmarkdown::render('0_Scripts/02_MatchingTable.rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')

load("1_Data/slrnew2.RData")

x<-as.data.frame(table(slrnew2$startyear))
library(ggplot2)
# Basic barplot
ggplot(data=x, aes(x=Var1, y=Freq)) +
  geom_bar(stat="identity")+
  geom_text(aes(label=Freq),vjust=-1.6)+
  labs(x="Year", y = "Number of PMGSY projects")+
  theme_classic()+  theme(strip.background = element_rect(size=1.5, linetype="blank"))+
  theme(strip.text.y = element_text(size=8, angle = 0, hjust = 1))
ggsave("3_Figs/FigB1.pdf", width=11.5, height=9)

log_close()


